package com.hup.sidebar.framework.util;

import com.hup.sidebar.BuildConfig;

/**
 * @author hugan
 * @date 2022/6/3
 */
@SuppressWarnings("SameReturnValue")
public class BuildConfigUtil {

    /**
     * @return gradle.android.defaultConfig.versionName, 如"1.0"
     */
    public static String getVersion() {
        return BuildConfig.VERSION_NAME;
    }

    /**
     * <pre>需要配置build.gradle
     * dependencies同级添加方法
     * def static yyyyMMdd_HHmmss() {
     * return new Date().format("yyyyMMdd_HHmmss", TimeZone.getTimeZone("GMT+8"))
     * }
     * android.defaultConfig下添加
     * buildConfigField 'String', 'packageTime', '\"' + yyyyMMdd_HHmmss() + '\"'
     * </pre>
     *
     * @return 打包时间
     */
    public static String getPackageTime() {
        return BuildConfig.packageTime;
    }

    /**
     * @return buildTypes[debug, release, ...]
     */
    public static String getBuildType() {
        return BuildConfig.BUILD_TYPE;
    }

    public static String applicationId() {
        return BuildConfig.APPLICATION_ID;
    }

}
